package com.design.decorate;

/**
 * 后置装饰类
 * @author cxx
 * @create 2020-04-20 15:48
 **/
public class AfterDecorator implements Decorator {

    private String afterWords;

    private Decorator decorator;

    public AfterDecorator(String afterWords, Decorator decorator) {
        this.afterWords = afterWords;
        this.decorator = decorator;
    }

    @Override
    public String describe(String name) {
        name = name + afterWords;
        return decorator.describe (name);
    }
}
